#include <vector>
#include <iostream>

using namespace std;

class Solution {
public:
    bool isRectangleOverlap(vector<int>& rec1, vector<int>& rec2) {
        int min_x = min(rec1[2], rec2[2]);
        int max_x = max(rec1[0], rec2[0]);
        if (min_x <= max_x) {
            return false;
        }
        int min_y = min(rec1[3], rec2[3]);
        int max_y = max(rec1[1], rec2[1]);
        if (min_y <= max_y) {
            return false;
        }
        return true;
    }
};